package com.me.jingdongshop.ui.activity;

import android.os.Message;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;

import com.me.common.base.BaseActivity;
import com.me.jingdongshop.R;

/**
 * Created by ldl on 2017/5/7.
 * 提交成功界面
 */

public class ShopcartSubmitActivity extends BaseActivity {
    private ImageButton ibSubmitBack;   // 提交成功返回
    private TextView tvOrderNo;         // 提交订单号
    private TextView tvOrderPrice;      // 提交应付金额
    private TextView tvOrderPaymode;    // 提交支付方式
    private TextView tvContinueShop;    // 继续购物
    private TextView tvOrderRead;       // 查看订单

    @Override
    public int getLayoutRes() {
        return R.layout.activity_shopcart_submit_result;
    }

    @Override
    public void initView() {
        ibSubmitBack = (ImageButton) findViewById(R.id.ib_submit_back);
        tvOrderNo = (TextView) findViewById(R.id.tv_order_no);
        tvOrderPrice = (TextView) findViewById(R.id.tv_order_price);
        tvOrderPaymode = (TextView) findViewById(R.id.tv_order_paymode);
        tvContinueShop = (TextView) findViewById(R.id.tv_continue_shop);
        tvOrderRead = (TextView) findViewById(R.id.tv_order_read);
    }

    @Override
    public void initListener() {
        ibSubmitBack.setOnClickListener(this);
        tvContinueShop.setOnClickListener(this);
        tvOrderRead.setOnClickListener(this);
    }

    @Override
    public void initData() {

    }

    @Override
    public void onClick(View v, int id) {
        switch (id) {
            case R.id.ib_submit_back:
                finish();
                break;
            case R.id.tv_continue_shop:
                Toast.makeText(getApplicationContext(), "跳转首页", Toast.LENGTH_SHORT).show();
                break;
            case R.id.tv_order_read:
                Toast.makeText(getApplicationContext(), "跳转订单详情页", Toast.LENGTH_SHORT).show();
                break;
        }
    }

    @Override
    public void onHttpSuccess(int reqType, Message msg) {

    }

    @Override
    public void onHttpError(int reqType, String error) {

    }
}
